package com.moonlit.myspring;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

/**
 * Created by Emou on 2021/1/18
 */
public class GuanYu implements Hero{

    @Autowired
    @Qualifier("halberd")
    private Weapon weapon;

    public Weapon getWeapon() {
        return weapon;
    }

    public void setWeapon(Weapon weapon) {
        this.weapon = weapon;
    }

    @Override
    public void perform() {
        System.out.println("GuanYu Attack");
        weapon.attack();
    }
}
